﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QuanLyShopCD
{
    public partial class frm_draw : Form
    {
        Boolean flag = false;
        int X_D, Y_D;
        Graphics g;
        public frm_draw()
        {
            InitializeComponent();
        }

        private void frm_draw_MouseDown(object sender, MouseEventArgs e)
        {
            if (!flag)
            {
                X_D = e.X;
                Y_D = e.Y;
                flag = true;
            }
        }

        private void frm_draw_MouseMove(object sender, MouseEventArgs e)
        {
            if (flag)
            {
                g.Clear(this.BackColor);
                Pen p = new Pen(Brushes.Red,4);
                g.DrawEllipse(p,X_D,Y_D,e.X,e.Y);
            }
        }

        private void frm_draw_Load(object sender, EventArgs e)
        {
            g = this.CreateGraphics();
        }

        private void frm_draw_MouseUp(object sender, MouseEventArgs e)
        {
            flag = false;
        }
    }
}
